package com.xzh.wms.controller;

import com.xzh.wms.dto.LoginDTO;
import com.xzh.wms.dto.RegisterDTO;
import com.xzh.wms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
public class UserController {

    @Autowired
    private UserService userService;

     @GetMapping("/sendCode")
    public Integer sendCode(String tel){
        return userService.sendCode(tel);
    }
    @PostMapping("/login")
    public String login(@RequestBody LoginDTO loginDTO){
        return userService.login(loginDTO);
    }
    @PostMapping("/login1")
    public String login1(@RequestBody LoginDTO loginDTO){
        return userService.login1(loginDTO);
    }
     @PostMapping("/register")
    public Integer register(@RequestBody RegisterDTO register){
        return userService.register(register);
    }
}
